package com.hutao.medical.mapper.quality;

import com.hutao.medical.pojo.quality.MedicalRecord;
import com.hutao.medical.pojo.quality.MedicalRecordExample;
import com.hutao.medical.pojo.vo.MedicalRecordVo;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

public interface MedicalRecordMapper {
    int countByExample(MedicalRecordExample example);

    int deleteByExample(MedicalRecordExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(MedicalRecord record);

    int insertSelective(MedicalRecord record);

    List<MedicalRecord> selectByExample(MedicalRecordExample example);

    MedicalRecord selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") MedicalRecord record, @Param("example") MedicalRecordExample example);

    int updateByExample(@Param("record") MedicalRecord record, @Param("example") MedicalRecordExample example);

    int updateByPrimaryKeySelective(MedicalRecord record);

    int updateByPrimaryKey(MedicalRecord record);
    
    /**
     * 根据唯一key查询病案记录是否存在
     * @param uniqueKey
     * @return
     */
    int getMedicalRecordCountByUniqueKey(@Param("uniqueKey")String uniqueKey);

    /**
     * 根据唯一key查询病案记录信息
     * @param uniqueKey
     * @return
     */
    MedicalRecord selectByUniqueKey(@Param("uniqueKey")String uniqueKey);
    
    
    /**
     * 根据唯一key查询病案质控信息
     * @param uniqueKey
     * @return
     */
    List<Map<String,Object>> selectListByUniqueKey(@Param("uniqueKey")String uniqueKey);
    
    /**
     * 查询质控信息
     * @param medicalRecordVo
     * @return
     */
    List<Map<String,Object>> selectQualityListByKeywords(MedicalRecordVo medicalRecordVo);
    
    /**
     * 导出质控信息到excel
     * @param medicalRecordVo
     * @return
     */
    List<Map<String,Object>> exportQualityListToExcel(MedicalRecordVo medicalRecordVo);
    /**
     * 查询质控信息数量
     * @param medicalRecordVo
     * @return
     */
    int selectQualityListCountByKeywords(MedicalRecordVo medicalRecordVo);
    
    
    /**
     * 根据uniqueKey查询质控信息
     * @return
     */
    List<Map<String,Object>> selectQualityListByUniqueKey(@Param("uniqueKey")String uniqueKey);
    
    /**
     * 根据科室统计质控信息
     * @return
     */
    List<Map<String,Object>> selectQualityConditionByOfficeName(MedicalRecordVo medicalRecordVo);
    
    /**
     * 根据uniqueKey获取质控信息
     * @param uniqueKey
     * @return
     */
    Map<String,Object> selectQuaPointsByUniqueKey(@Param("uniqueKey")String uniqueKey);
    
    
    /**
     * 根据质控信息id查询
     * @param mqcId
     * @return
     */
    Map<String,Object> selectQualityByMqcId(@Param("mqcId")Integer mqcId);
  

  
}